<template>
  <!-- <div id="nav">
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link>

    <el-button type="primary" @click="test">确定</el-button>
  </div> -->
  <router-view />
</template>

<script lang="ts">
import { defineComponent, getCurrentInstance, ComponentPublicInstance } from 'vue'
import Axios from 'axios';
import { doLogin as loginApi } from '@/api/user';
export default defineComponent({
  setup() {
    const instance = getCurrentInstance();
    const proxy = instance?.proxy as ComponentPublicInstance
    window.a = 1;
    console.log(proxy.$abc, 'proxy.$abc');
    console.log(window.a, 'window.a');

    const test = async () => {
      const res = await loginApi({ account: '1', password: '2' });
      console.log(res, 'res');
    //AxiosPromise =>  res.data
    // IResData => data + code
    // IUserData => token
      res.data.data.token

    }
    return {
      test
    }
  }
})

</script>


<style lang="scss">

</style>
